//  -------------------- iSharePoint -------------------- //
// 
//  Company:	IT Complex, LLC
//  Project:	Smart.Common
//  File name:	ITemplateFactory.cs
//  Developer:	Solomatov Igor
//  Created:	15.04.2012
// 
//  -------------------- iSharePoint -------------------- //

using System.Collections.Generic;

namespace Smart.Common.Templates
{
	/// <summary>
	/// Template factory
	/// </summary>
	public interface ITemplateFactory
	{
		/// <summary>
		/// Get service by serviceName
		/// </summary>
		ITemplateService GetService(string serviceName);

		/// <summary>
		/// Create new template filter
		/// </summary>
		TemplateFilter CreateFilter(string serviceName);

		/// <summary>
		/// Returns list of templates
		/// </summary>
		IList<ITemplate> GetTemplates(string serviceName, TemplateFilter filter);

		/// <summary>
		/// Returns list of templates
		/// </summary>
		IList<TTemplateType> GetTemplates<TTemplateType>(string serviceName, TemplateFilter filter)
			where TTemplateType : class, ITemplate;

		/// <summary>
		/// Format template
		/// </summary>
		bool Format(string serviceName, string templateId, string instanceId, IDictionary<string, object> values);

		/// <summary>
		/// Format template
		/// </summary>
		ITemplateInstance Format(string serviceName, ITemplate template, string instanceId, IDictionary<string, object> values);

		/// <summary>
		/// Format template
		/// </summary>
		object FormatData(string serviceName, object templateData, IDictionary<string, object> values);

		/// <summary>
		/// Format template
		/// </summary>
		object FormatData(string serviceName, string templateId, IDictionary<string, object> values);
	}
}